aboutsummaryrefslogtreecommitdiff
path: root/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenDefineFunctionTests]/[method:effectHandlerMethodSwapsEffectHandlerInBody(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
blob: 57e4ffa046c3c7a14e8f44b2e133542d377dffd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Compilation unit elements:

(
    function-decl
    "shed__runtime__effects_get_handler"
    params=()
    return-type=data-ptr
)
(
    function-decl
    "shed__runtime__effects_set_handler"
    params=((param "effectHandler" data-ptr))
    return-type=void
)
(
    function
    "shed__effectHandlerMethod__f__0"
    visibility=private
    locals=((param "closurePointer__0" data-ptr) (val "effectHandler__0" data-ptr) (val "effectHandler__1" data-ptr) (val "tmp__0" int))
    return-type=int
    body=(
        (call (local "effectHandler__0") "shed__runtime__effects_get_handler" ())
        (
            memory-load
            (local "effectHandler__1")
            pointer=(local "closurePointer__0")
            layout=(struct (data-ptr (struct (function-ptr (struct (data-ptr)) (struct ())))))
            offset=(1 1 0)
        )
        (call _ "shed__runtime__effects_set_handler" ((local "effectHandler__1")))
        (local-store (local "tmp__0") (int 0))
        (call _ "shed__runtime__effects_set_handler" ((local "effectHandler__0")))
        (resume (local "tmp__0"))
    )
)

Locals:
 * (val "closure__f__0" int)
 * (val "closurePointer__f__0" data-ptr)
 * (val "effectHandlerCurrent__0" data-ptr)

Instructions:

(
    (alloc-heap (local "closurePointer__f__0") (struct (data-ptr (struct (function-ptr (struct (data-ptr)) (struct ()))))))
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (data-ptr (struct (function-ptr (struct (data-ptr)) (struct ())))))
        offset=(1 0)
        value=(function-ptr "shed__effectHandlerMethod__f__0")
    )
    (call (local "effectHandlerCurrent__0") "shed__runtime__effects_get_handler" ())
    (
        memory-store
        pointer=(local "closurePointer__f__0")
        layout=(struct (data-ptr (struct (function-ptr (struct (data-ptr)) (struct ())))))
        offset=(1 1 0)
        value=(local "effectHandlerCurrent__0")
    )
    (data-ptr-to-int (local "closure__f__0") (local "closurePointer__f__0"))
)

Temporary stack:
 * PatioLocalRef[name=closure__f__0]